package com.maserb.monitor.entity;

import com.maserb.monitor.dataCenter.communication.EigenWarningStatusEnum;
import lombok.Data;

import javax.persistence.Table;
import java.sql.Date;

@Data
@Table(name = "eigen_value")
public class EigenValueEntity {
    private String id;
    private String deviceCode;
    private String pointCode;
    private Date sampleTime;
    private String value0;
    private String value1;
    private String value2;
    private String value3;
    private String value4;
    private String value5;
    private String value6;
    private String value7;
    private String value8;

    public void setValueAndStatusX(int x, String valueType, EigenWarningStatusEnum status, Float val) {
        String strValue = valueType + "|" + status.getValue() + "|" + val;
        switch (x) {
            case 0:
                value0 = strValue;
                break;
            case 1:
                value1 = strValue;
                break;
            case 2:
                value2 = strValue;
                break;
            case 3:
                value3 = strValue;
                break;
            case 4:
                value4 = strValue;
                break;
            case 5:
                value5 = strValue;
                break;
            case 6:
                value6 = strValue;
                break;
            case 7:
                value7 = strValue;
                break;
            case 8:
                value8 = strValue;
                break;
        }
    }
}